package com.shixun.milktea.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Zourongsheng
 * @version 1.0
 * @date 2022/6/1 13:12
 */
@Getter
@AllArgsConstructor
public enum  ResultStatusEnum {
    //1000系列  通用错误
    SUCCESS(200,"操作成功"),
    FAILED(500,"接口错误"),
    VALIDATE_FAILED(1002,"参数校验失败"),
    ERROR(1003,"未知错误"),
    FILE_SIZE_OVERFLOW(1004,"上传文件字节被限制"),

    //2000系列 用户错误
    USER_NOT_EXIST(2000,"用户不存在"),
    USER_LOGIN_FAIL(2001,"用户名或密码错误"),
    USER_NOT_LOGIN(2002,"用户还未登录，请先登录"),
    NO_PERMISSION(2003,"权限不足，请联系管理员"),
    USER_LOGOUT_SUCCESS(2004,"登出成功"),
    USER_ALREADY_EXIST(2005,"用户已存在"),
    /* 业务错误：3001-39999 */
    SPECIFIED_QUESTIONED_USER_NOT_EXIST(3001, "业务逻辑出现问题"),

    /* 系统错误：4001-4999 */
    SYSTEM_INNER_ERROR(4001, "系统内部错误，请稍后重试"),
    PAGE_NOT_FOUND(4004, "页面未找到"),

    /* 数据错误：5001-59999 */
    DATA_NONE(5001, "数据未找到"),
    DATA_WRONG(5002, "数据错误"),
    DATA_EXISTED(5003, "数据已存在"),

    /* 接口错误：6001-6999 */
    INTERFACE_INNER_INVOKE_ERROR(6001, "内部系统接口调用异常"),
    INTERFACE_OUTTER_INVOKE_ERROR(6002, "外部系统接口调用异常"),
    INTERFACE_FORBID_VISIT(6003, "该接口禁止访问"),
    INTERFACE_ADDRESS_INVALID(6004, "接口地址无效"),
    INTERFACE_REQUEST_TIMEOUT(6005, "接口请求超时"),

    /* 权限错误：70001-79999 */
    PERMISSION_NO_ACCESS(7001, "无访问权限"),
    PERMISSION_NO_UPDATE(7002, "无更新权限"),
    PERMISSION_NO_ADD(7003, "无添加权限"),
    PERMISSION_NO_SELECT(7005, "无查询权限"),
    PERMISSION_NO_DELETE(7004, "无删除权限");

    private final Integer code;
    private final String msg;

}
